<?php
$_SERVER['DOCUMENT_ROOT']="d:/collect_new";
define("APP_PATH",$_SERVER['DOCUMENT_ROOT']."/collect/");
include_once($_SERVER['DOCUMENT_ROOT']."/collect/config.php");
include_once(APP_PATH . "Common/yzs1013_pldr.php");
include_once(APP_PATH . "reset/jsondecode_inc.php");
include_once(APP_PATH . "Lib/ORG/Zqnews.class.php");
include_once(APP_PATH . "Common/common.php");
include_once($_SERVER['DOCUMENT_ROOT'] . "/collect/reset/nodecode_inc.php");
require_once($_SERVER['DOCUMENT_ROOT'].'/vendor/autoload.php');
$options=array();
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverExpectedCondition;
use Facebook\WebDriver\WebDriverWait;
use Facebook\WebDriver\WebDriverJavascriptExecutor;
use Facebook\WebDriver\Interactions\WebDriverActions;
use Facebook\WebDriver\Cookie;
use Facebook\WebDriver\Remote\RemoteWebElement;
use Facebook\WebDriver\ExpectedConditions;
$url="https://channels.weixin.qq.com/shop/goods/entry?productId=10000143263336&isUpdateAuditFree=0&source=list_edit";
$options = new ChromeOptions();
$options->addArguments(['--disable-blink-features=AutomationControlled']);
$options->addArguments(['--disable-extensions']);
$options->addArguments(['--disable-gpu']);
$options->addArguments(['--disable-infobars']);
$options->addArguments(['--disable-notifications']);
$options->addArguments(['--disable-popup-blocking']);
$options->addArguments(['--disable-web-security']);
$options->addArguments(['--ignore-certificate-errors']);
$options->addArguments(['--disable-site-isolation-trials']);
$options->addArguments(['--disable-popup-blocking']);
$options->addArguments(['--disable-blink-features=AutomationControlled']);
$options->addArguments(['--disable-features=IsolateOrigins,site-per-process']);
$options->addArguments(['--allow-file-access-from-files']);
$options->addArguments(['--no-sandbox']);
$options->setExperimentalOption("useAutomationExtension", false);
$options->setExperimentalOption("excludeSwitches", ['enable-automation']);
$options->setExperimentalOption('prefs', [
    'profile.default_content_settings.popups' => 0,
    'download.default_directory' => '/d/temp',
]);
$options->addArguments(['--user-data-dir=/d/temp']);
$capabilities = DesiredCapabilities::chrome();
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
$driver = RemoteWebDriver::create('http://localhost:9515', $capabilities);